<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src\assets\scripts\common\utility.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../../../prettify.css" />
    <link rel="stylesheet" href="../../../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../../../index.html">all files</a> / <a href="index.html">src/assets/scripts/common/</a> utility.js
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">7.34% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>8/109</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/49</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">12.5% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>1/8</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">6.73% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>7/104</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">39×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import Calculate from './calculate';
import Cookie from './cookie';
&nbsp;
/* eslint-disable camelcase */
/* eslint-disable no-console */
/* eslint-disable no-magic-numbers */
let extensionMap = {
	/* ===== List ===== */
	$__utilityList() {
<span class="cstat-no" title="statement not covered" >		return Object.keys(extensionMap);</span>
	},
	/* ===== Number ===== */
	$toMoney(num) {
<span class="cstat-no" title="statement not covered" >		return num.toFixed(2).replace(/(\d{1,3})(?=(?:\d{3})+(?:\.|$))/g, '$1,');</span>
	},
	$plus(num1, num2) {
		try {
			return +new Calculate(num1).plus(num2);
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn(ex);</span>
<span class="cstat-no" title="statement not covered" >			return NaN;</span>
		}
	},
	$minus(num1, num2) {
<span class="cstat-no" title="statement not covered" >		try {</span>
<span class="cstat-no" title="statement not covered" >			return +new Calculate(num1).minus(num2);</span>
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn(ex);</span>
<span class="cstat-no" title="statement not covered" >			return NaN;</span>
		}
	},
	$multiply(num1, num2) {
		try {
			return +new Calculate(num1).multiply(num2);
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn(ex);</span>
<span class="cstat-no" title="statement not covered" >			return NaN;</span>
		}
	},
	$divide(num1, num2) {
<span class="cstat-no" title="statement not covered" >		try {</span>
<span class="cstat-no" title="statement not covered" >			return +new Calculate(num1).divide(num2);</span>
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn(ex);</span>
<span class="cstat-no" title="statement not covered" >			return NaN;</span>
		}
	},
	$remainder(num1, num2) {
<span class="cstat-no" title="statement not covered" >		try {</span>
<span class="cstat-no" title="statement not covered" >			return +new Calculate(num1).remainder(num2);</span>
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn(ex);</span>
<span class="cstat-no" title="statement not covered" >			return NaN;</span>
		}
	},
	$modulo(num1, num2) {
<span class="cstat-no" title="statement not covered" >		try {</span>
<span class="cstat-no" title="statement not covered" >			return +new Calculate(num1).modulo(num2);</span>
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn(ex);</span>
<span class="cstat-no" title="statement not covered" >			return NaN;</span>
		}
	},
	$compare(num1, num2) {
		let diff = <span class="cstat-no" title="statement not covered" >0;</span>
<span class="cstat-no" title="statement not covered" >		try {</span>
<span class="cstat-no" title="statement not covered" >			diff = +new Calculate(num1).minus(num2);</span>
		} catch(ex) {
<span class="cstat-no" title="statement not covered" >			console.warn('Result may NOT reliable.');</span>
<span class="cstat-no" title="statement not covered" >			diff = num1 - num2;</span>
<span class="cstat-no" title="statement not covered" >			diff = Math.abs(diff) - 0 &gt;= Number.EPSILON ? diff : 0;</span>
		}
<span class="cstat-no" title="statement not covered" >		return diff &gt; 0 &amp;&amp; '&gt;' || diff &lt; 0 &amp;&amp; '&lt;' || diff === 0 &amp;&amp; '=';</span>
	},
	$eq(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$compare(num1, num2) === '=';</span>
	},
	$neq(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$compare(num1, num2) !== '=';</span>
	},
	$lt(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$compare(num1, num2) === '&lt;';</span>
	},
	$gt(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$compare(num1, num2) === '&gt;';</span>
	},
	$lte(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$compare(num1, num2) !== '&gt;';</span>
	},
	$gte(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$compare(num1, num2) !== '&lt;';</span>
	},
	$smaller(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$lte(num1, num2) ? num1 : num2;</span>
	},
	$larger(num1, num2) {
<span class="cstat-no" title="statement not covered" >		return this.$gte(num1, num2) ? num1 : num2;</span>
	},
	/* ===== String ===== */
	$toCodePointArray(str) {
		let codePointArr = <span class="cstat-no" title="statement not covered" >[];</span>
		let i = <span class="cstat-no" title="statement not covered" >0,</span>
			len = <span class="cstat-no" title="statement not covered" >str.length;</span>
<span class="cstat-no" title="statement not covered" >		for (; this.$lt(i, len);) {</span>
<span class="cstat-no" title="statement not covered" >			codePointArr.push(str.codePointAt(i));</span>
<span class="cstat-no" title="statement not covered" >			i += this.$gt(str.codePointAt(i), 0xFFFF) + 1;</span>
		}
<span class="cstat-no" title="statement not covered" >		return codePointArr;</span>
	},
	$toUnicode(str) {
<span class="cstat-no" title="statement not covered" >		return this.$toCodePointArray(str).map(item =&gt; <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >`\\u{${item.toString(16)}}`)</span></span>.join('');</span>
	},
	$toCamelCase(str) {
<span class="cstat-no" title="statement not covered" >		return str.trim().replace(/^[A-Z]/, $1 =&gt; <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >$1.toLowerCase())</span></span>.replace(/\s?([a-z])/g, $1 =&gt; <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >$1.toUpperCase())</span></span>;</span>
	},
	$stringLength(str) {
<span class="cstat-no" title="statement not covered" >		return [...str].length;</span>
	},
	$sliceString(str, start = 0, end) {
<span class="cstat-no" title="statement not covered" >		return [...str].slice(start, end != null ? end : this.$stringLength(str)).join('');</span>
	},
	$thousandSeparate(str) {
<span class="cstat-no" title="statement not covered" >		return [...str].reverse().join('').replace(/(\d{3})(?=\d+$)/g, '$1,').split('').reverse().join('');</span>
	},
	$getURLSearchParam(key, search = location.search) {
<span class="cstat-no" title="statement not covered" >		return (new RegExp(`\\?(?:.+(?:&amp;|=))?${key}=([^&amp;#]*)(?:&amp;|#|$)`).exec(search) || [])[1] || '';</span>
	},
	$padString(str, char = '', len = 0, pos = 0, cut = false) {
		let strLen = <span class="cstat-no" title="statement not covered" >this.$stringLength(str);</span>
<span class="cstat-no" title="statement not covered" >		if (this.$lte(pos, 0)) {</span>
<span class="cstat-no" title="statement not covered" >			pos = this.$plus(strLen, pos);</span>
		}
<span class="cstat-no" title="statement not covered" >		if (this.$lte(len, strLen)) {</span>
<span class="cstat-no" title="statement not covered" >			return cut ? !pos ? this.$sliceString(str, -len) : this.$sliceString(str, 0, len) : str;</span>
		}
<span class="cstat-no" title="statement not covered" >		return `${this.$sliceString(str, 0, pos)}${char.repeat(this.$minus(len, strLen))}${this.$sliceString(str, pos)}`;</span>
	},
	$maskString(str, char = '', start = 0, end = 0) {
		let strLen = <span class="cstat-no" title="statement not covered" >this.$stringLength(str);</span>
<span class="cstat-no" title="statement not covered" >		if (this.$lte(start, 0)) {</span>
<span class="cstat-no" title="statement not covered" >			start = this.$plus(strLen, start);</span>
		}
<span class="cstat-no" title="statement not covered" >		if (this.$lte(end, 0)) {</span>
<span class="cstat-no" title="statement not covered" >			end = this.$plus(strLen, end);</span>
		}
<span class="cstat-no" title="statement not covered" >		start = this.$smaller(this.$larger(start, 0), strLen);</span>
<span class="cstat-no" title="statement not covered" >		end = this.$smaller(this.$larger(end, 0), strLen);</span>
<span class="cstat-no" title="statement not covered" >		if (this.$gte(start, end)) {</span>
<span class="cstat-no" title="statement not covered" >			return str;</span>
		}
		let charLen = <span class="cstat-no" title="statement not covered" >this.$minus(end, start);</span>
<span class="cstat-no" title="statement not covered" >		return this.$spliceArray([...str], start, charLen, char.repeat(charLen)).join('');</span>
	},
	$encodeHTML(str) {
<span class="cstat-no" title="statement not covered" >		return str.replace(/&amp;/g, '&amp;amp;')</span>
			.replace(/&lt;/g, '&amp;lt;')
			.replace(/&gt;/g, '&amp;gt;')
			.replace(/ /g, '&amp;nbsp;')
			.replace(/'/g, '&amp;#39;')
			.replace(/"/g, '&amp;quot;');
	},
	$decodeHTML(str) {
<span class="cstat-no" title="statement not covered" >		return str.replace(/&amp;amp;/g, '&amp;')</span>
			.replace(/&amp;lt;/g, '&lt;')
			.replace(/&amp;gt;/g, '&gt;')
			.replace(/&amp;nbsp;/g, ' ')
			.replace(/&amp;#39;/g, '\'')
			.replace(/&amp;quot;/g, '"');
	},
	$toSafeString(tpl, ...args) {
<span class="cstat-no" title="statement not covered" >		return tpl.slice(1).reduce((res, currVal, currIdx) =&gt; <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >`${res}${args[currIdx].replace(/&amp;/g, '&amp;amp;')</span></span></span>
			.replace(/&lt;/g, '&amp;lt;')
			.replace(/&gt;/g, '&amp;gt;')}${currVal}`, tpl[0]);
	},
	$getCookie(key) {
<span class="cstat-no" title="statement not covered" >		return Cookie.getCookie(key);</span>
	},
	$setCookie(key, val, opt) {
<span class="cstat-no" title="statement not covered" >		return Cookie.setCookie(key, val, opt);</span>
	},
	$clearCookie() {
<span class="cstat-no" title="statement not covered" >		return Cookie.clearCookie();</span>
	},
	$getUserAgentClient(ua = navigator.userAgent) {
		let result = <span class="cstat-no" title="statement not covered" >{};</span>
<span class="cstat-no" title="statement not covered" >		Object.entries({</span>
			'iPad|iPhone|iPod': 'iOS',
			'Android': 'Android',
			'MicroMessenger': 'WeChat',
			'Windows [^P][^h][^o][^n][^e]': 'Windows',
			'Linux(?!.+Android)': 'Linux',
			'Macintosh': 'Mac',
			'Windows Phone': 'Windows Phone'
		}).forEach(([key, val]) =&gt; <span class="fstat-no" title="function not covered" >{</span>
<span class="cstat-no" title="statement not covered" >			result[val] = new RegExp(key, 'i').test(ua);</span>
		});
<span class="cstat-no" title="statement not covered" >		return result;</span>
	},
	/* ===== Object ===== */
	$deepClone(obj) {
<span class="cstat-no" title="statement not covered" >		return JSON.parse(JSON.stringify(obj));</span>
	},
	/* ===== Array ===== */
	$uniqueArray(arr) {
<span class="cstat-no" title="statement not covered" >		return Array.from(new Set(arr));</span>
	},
	$inArray(item, arr) {
		return !!~arr.indexOf(item);
	},
	$spliceArray(arr, start, len, rpl) {
<span class="cstat-no" title="statement not covered" >		arr.splice(start, len, rpl);</span>
<span class="cstat-no" title="statement not covered" >		return arr;</span>
	},
	/* ===== Date ===== */
	$dateFormat(date, fmt = 'yyyy-MM-dd hh:mm:ss') {
<span class="cstat-no" title="statement not covered" >		return fmt.replace(/(^|.*[^y])(yyyy)([^y].*|$)/, `$1${date.getFullYear()}$3`)</span>
			.replace(/(^|.*[^y])(yy)([^y].*|$)/, `$1${date.getFullYear().toString().slice(-2)}$3`)
			.replace(/(^|.*[^M])(MM)([^M].*|$)/, `$1${(date.getMonth() + 1).toString().padStart(2, '0')}$3`)
			.replace(/(^|.*[^M])(M)([^M].*|$)/, `$1${date.getMonth() + 1}$3`)
			.replace(/(^|.*[^d])(dd)([^d].*|$)/, `$1${date.getDate().toString().padStart(2, '0')}$3`)
			.replace(/(^|.*[^d])(d)([^d].*|$)/, `$1${date.getDate()}$3`)
			.replace(/(^|.*[^h])(hh)([^h].*|$)/, `$1${date.getHours().toString().padStart(2, '0')}$3`)
			.replace(/(^|.*[^h])(h)([^h].*|$)/, `$1${date.getHours()}$3`)
			.replace(/(^|.*[^m])(mm)([^m].*|$)/, `$1${date.getMinutes().toString().padStart(2, '0')}$3`)
			.replace(/(^|.*[^m])(m)([^m].*|$)/, `$1${date.getMinutes()}$3`)
			.replace(/(^|.*[^s])(ss)([^s].*|$)/, `$1${date.getSeconds().toString().padStart(2, '0')}$3`)
			.replace(/(^|.*[^s])(s)([^s].*|$)/, `$1${date.getSeconds()}$3`);
	},
	/* ===== Function ===== */
	$makeGenerator(func) {
		let gen = <span class="cstat-no" title="statement not covered" >function* (ipt) <span class="fstat-no" title="function not covered" >{</span></span>
<span class="cstat-no" title="statement not covered" >			for (; ;) {</span>
<span class="cstat-no" title="statement not covered" >				ipt = yield func(ipt);</span>
			}
		};
		let n = <span class="cstat-no" title="statement not covered" >0;</span>
		let g;
		let init = <span class="cstat-no" title="statement not covered" >function (arg) <span class="fstat-no" title="function not covered" >{</span></span>
<span class="cstat-no" title="statement not covered" >			g = gen(arg);</span>
		};
<span class="cstat-no" title="statement not covered" >		return {</span>
			next(arg) {
<span class="cstat-no" title="statement not covered" >				if (n++) {</span>
<span class="cstat-no" title="statement not covered" >					return g.next(arg);</span>
				}
<span class="cstat-no" title="statement not covered" >				init(arg);</span>
<span class="cstat-no" title="statement not covered" >				return g.next();</span>
			},
			return(arg) {
<span class="cstat-no" title="statement not covered" >				n++ || init(arg);</span>
<span class="cstat-no" title="statement not covered" >				return g.return(arg);</span>
			},
			throw(err) {
<span class="cstat-no" title="statement not covered" >				n++ || init(err);</span>
<span class="cstat-no" title="statement not covered" >				return g.throw(err);</span>
			}
		};
	}
};
&nbsp;
export default {
	install(Vue, options) {
		Object.entries(extensionMap).forEach(([key, val]) =&gt; Vue[key] = Vue.prototype[key] = val);
	}
};
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Jan 16 2018 10:36:09 GMT+0800 (中国标准时间)
</div>
</div>
<script src="../../../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../../../sorter.js"></script>
</body>
</html>
